import numpy as np
closing_price=\
                np.loadtxt("stock.csv",\
                           delimiter=',',\
                           usecols=(2),\
                           unpack=False)
volue=np.loadtxt("stock.csv",delimiter=',',usecols=(11),unpack=False)


vmap=np.average(closing_price,weights=volue)
print("该股票的成交量加权平均值是：%.2f" %vmap)
avg=np.mean(closing_price)
print("收盘价的平均值是：%.2f" %avg)

t=np.arange(closing_price.shape[0])
twap=np.average(closing_price,weights=t)
print(print("该股票的时间加权平均值是：%.2f" %twap))
